﻿using System.IO;
using System.Xml.Serialization;

namespace MS.InformationManagement.DAL.DocumentCenter
{
    public partial class HistorialDeBusqueda
    {
        public SearchConfig SearchConfig
        {
            get
            {
                SearchConfig deserializedObject = null;
                if (!string.IsNullOrEmpty(ConfiguraciónBusqueda))
                {
                    XmlSerializer tSerializer = new XmlSerializer(typeof(SearchConfig));
                    using (StringReader sReader = new StringReader(ConfiguraciónBusqueda)) {
                        deserializedObject = tSerializer.Deserialize(sReader) as SearchConfig;
                    }
                    
                }
                return deserializedObject;
            }
            set
            {
                XmlSerializer tSerializer = new XmlSerializer(typeof(SearchConfig));
                using (StringWriter sWriter = new StringWriter())
                {
                    tSerializer.Serialize(sWriter, value);
                    ConfiguraciónBusqueda = sWriter.ToString();
                }
            }
        }
    }
}
